package cn.egame.extraction.service;

import org.apache.log4j.Logger;

import cn.egame.common.exception.ExceptionCommonBase;
import cn.egame.extraction.dao.GameTagDao;
import cn.egame.interfaces.EnumType.GameTagType;
import cn.egame.interfaces.gc.GameTagInfo;

public class GameTagService {
	private static GameTagService instance = null;
	private static byte[] lock = new byte[0];
	private Logger log = Logger.getLogger(GameTagService.class);
	public static GameTagService getInstance() throws ExceptionCommonBase {
		if (instance == null) {
			synchronized (lock) {
				if (instance == null) {
					instance = new GameTagService();
				}
			}
		}
		return instance;
	}

	private GameTagDao dao = null;
	public GameTagService() throws ExceptionCommonBase {
		dao = new GameTagDao();
	}

	public int getGameTagId(String tagName) throws ExceptionCommonBase {
		return dao.getGameTagId(tagName);
	}

	public void deleteGameTagIdByGameTagType(GameTagType gameTagType)
			throws ExceptionCommonBase {
		dao.deleteGameTagIdByGameTagType(gameTagType);
	}

	public int setGameTagInfo(GameTagInfo gameTagInfo)throws ExceptionCommonBase  {
		return dao.setGameTagInfo(gameTagInfo);
	}
	public int updateGameTagCountClickByTagIdAndTagType(int tagId,
			GameTagType gameTagType, long countClick)throws ExceptionCommonBase  {
		return dao.updateGameTagCountClickByTagIdAndTagType(tagId, gameTagType, countClick);
	}
}
